]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: fix disable-user-list / Not Listed?
authorRay Strode <rstrode@redhat.com>
Fri, 2 Aug 2013 18:10:16 +0000 (14:10 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 6 Aug 2013 02:10:06 +0000 (22:10 -0400)
If the first question asked to a user is from the
shell and not from the PAM service (i.e. Username: ),
then we'll save what the user types until PAM asks
a question and then try to send it to PAM.

This commit makes sure the preemptive answer can be used
before the PAM conversation gets started, and makes sure
to discard the preemptive answer if we're not expecting it.

https://bugzilla.gnome.org/show_bug.cgi?id=705370

js/gdm/authPrompt.js

index 7bda7b5ac2c614bae661709df26dd3477f852d06..07a92b7717c2974d701d5a9434dc3ecd9a2bac1a 100644 (file)
@@ -190,7 +190,8 @@ const AuthPrompt = new Lang.Class({
 
     _onAskQuestion: function(verifier, serviceName, question, passwordChar) {
         if (this._preemptiveAnswer) {
-            this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
+            if (this._queryingService)
+                this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
             this._preemptiveAnswer = null;
             return;
         }
@@ -341,7 +342,14 @@ const AuthPrompt = new Lang.Class({
     },
 
     getAnswer: function() {
-        let text = this._entry.get_text();
+        let text;
+
+        if (this._preemptiveAnswer) {
+            text = this._preemptiveAnswer;
+            this._preemptiveAnswer = null;
+        } else {
+            text = this._entry.get_text();
+        }
 
         return text;
     },